<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        /* 
            ():括号里面的内容会被当做一个整体进行匹配
        */
        const re = /^(abc){2}$/;
        console.log(re.test("abc")); // false
        console.log(re.test("abcabc")); // true
        console.log(re.test("abcaaa")); //false
        console.log(re.test("abcabb")); //false
        console.log(re.test("abcabcabc")); //false
    </script>
</body>

</html>